home *** CD-ROM | disk | FTP | other *** search
/ Apple WWDC 1996 / WWDC96_1996 (CD).toast / Technology Materials / MacOS 8 Resources / Developer Tools / Mac OS 8 Interfaces & Libraries / Interfaces / AIncludes / BlockStorage.a < prev    next >
Encoding:
Text File  |  1996-05-01  |  74.3 KB  |  2,263 lines  |  [TEXT/MPS ]

  1. ;
  2. ;    File:        BlockStorage.a
  3. ;
  4. ;    Contains:    External interfaces to Block Storage Family
  5. ;
  6. ;    Version:    Technology:    Copland
  7. ;                Release:    Universal Interfaces 3.0d3 on Copland DR1
  8. ;
  9. ;    Copyright:    © 1984-1996 by Apple Computer, Inc.  All rights reserved.
  10. ;
  11. ;    Bugs?:        If you find a problem with this file, send the file and version
  12. ;                information (from above) and the problem description to:
  13. ;
  14. ;                    Internet:    apple.bugs@applelink.apple.com
  15. ;                    AppleLink:    APPLE.BUGS
  16. ;
  17. ;
  18.     IF &TYPE('__BLOCKSTORAGE__') = 'UNDEFINED' THEN
  19. __BLOCKSTORAGE__ SET 1
  20.  
  21.     IF &TYPE('__TYPES__') = 'UNDEFINED' THEN
  22.     include 'Types.a'
  23.     ENDIF
  24.     IF &TYPE('__MATH64__') = 'UNDEFINED' THEN
  25.     include 'Math64.a'
  26.     ENDIF
  27.     IF &TYPE('__ERRORS__') = 'UNDEFINED' THEN
  28.     include 'Errors.a'
  29.     ENDIF
  30.     IF &TYPE('__NAMEREGISTRY__') = 'UNDEFINED' THEN
  31.     include 'NameRegistry.a'
  32.     ENDIF
  33.     IF &TYPE('__IOMEMORYLISTS__') = 'UNDEFINED' THEN
  34.     include 'IOMemoryLists.a'
  35.     ENDIF
  36.     IF &TYPE('__IOITERATOR__') = 'UNDEFINED' THEN
  37.     include 'IOIterator.a'
  38.     ENDIF
  39.     IF FOR_SYSTEM8_PREEMPTIVE THEN
  40. ;
  41. ;******************************************************************************
  42. ; *******************************************************************************
  43. ; *******************************************************************************
  44. ;
  45. ; Block Storage Constants
  46. ;    
  47. ; *******************************************************************************
  48. ; *******************************************************************************
  49. ; *****************************************************************************
  50. ;
  51. ;
  52. ;******************************************************************************
  53. ;    
  54. ;    Store property names
  55. ;    
  56. ; *****************************************************************************
  57. ;
  58. ;
  59. ;******************************************************************************
  60. ;    
  61. ;    Container property names
  62. ;    
  63. ; *****************************************************************************
  64. ;
  65. ;
  66. ;******************************************************************************
  67. ;
  68. ;    StoreOpenOptions is the set of permissions available when making a Connection
  69. ;    to a Store.  These options can be OR'd together in any combination. 
  70. ;    
  71. ; *****************************************************************************
  72. ;
  73.  
  74. kBSStoreRead                    EQU        $00000001            ; Allow reading/positioning 
  75. kBSStoreWrite                    EQU        $00000002            ; Allow writing 
  76. kBSStoreExclusiveIO                EQU        $00000004            ; Don't allow another IO Connection to be opened 
  77. kBSStoreExclusiveCntrl            EQU        $00000008            ; Don't allow another control Connection to be opened 
  78. kBSStoreResizeOK                EQU        $00000010            ; Resizing of the Store is OK (but, of course, notify me) 
  79. kBSStoreControl                    EQU        $00000020            ; Allow me to control the Store 
  80. ; typedef UInt32                         BSStoreOpenOptions
  81.  
  82. ;
  83. ;******************************************************************************
  84. ;
  85. ;    BSContainerOpenOptions is the set of permissions available when making a 
  86. ;    Connection to a Container.  These options can be OR'd together in any combination. 
  87. ;    
  88. ; *****************************************************************************
  89. ;
  90.  
  91. kBSContainerExclusiveCntrl        EQU        $00000001            ; Don't allow another Connection to be opened 
  92. ; typedef UInt32                         BSContainerOpenOptions
  93.  
  94. ;
  95. ;****************************************************************************
  96. ;     
  97. ;    Accessibility states
  98. ;     Accessibility States indicate how accessible a Block Storage Container or
  99. ;         Store is.  There are four currently defined.  Their absolute values 
  100. ;        are unimportant, but have been split across fairly large ranges to 
  101. ;        allow for future values to be inserted between them.
  102. ;         kBSOnline and kBSOffline represent the two extremes of accessibility -
  103. ;         nothing can be less accessible than kBSOffline (that is the state you 
  104. ;        send a Store to when you are about to delete it) and nothing can be 
  105. ;        more online than kBSOnline, which means you are fully, 100% available.
  106. ;        
  107. ; ***************************************************************************
  108. ;
  109.  
  110. kBSOnline                        EQU        $0FFFFFFF
  111. kBSPowerSave                    EQU        $0A000000
  112. kBSOutOfDrive                    EQU        $01000000
  113. kBSOffline                        EQU        0
  114. ; typedef UInt32                         BSAccessibilityState
  115.  
  116. ;
  117. ;****************************************************************************
  118. ;    
  119. ;    Component types
  120. ;
  121. ; ***************************************************************************
  122. ;
  123.  
  124. kBSExternalDeviceComponent        EQU        1
  125. kBSStoreComponent                EQU        2
  126. ; typedef UInt32                         BSComponentType
  127.  
  128. ;
  129. ;****************************************************************************
  130. ;
  131. ;    Block List Seek specifiers
  132. ;    
  133. ; ***************************************************************************
  134. ;
  135.  
  136. kBSBlockListSeekByteAbsolute    EQU        1
  137. kBSBlockListSeekByteRelative    EQU        2
  138. kBSBlockListSeekExtentAbsolute    EQU        3
  139. kBSBlockListSeekExtentRelative    EQU        4
  140. kBSBlockListSeekBlockAbsolute    EQU        5
  141. kBSBlockListSeekBlockRelative    EQU        6
  142. ; typedef UInt32                         BSBlockListWhence
  143.  
  144. ;
  145. ;****************************************************************************
  146. ;
  147. ;    Selectors for BSStoreGetDeviceData - specifies which set of Stores to
  148. ;        return
  149. ;
  150. ; ***************************************************************************
  151. ;
  152.  
  153. kBSStoreGetLeafStores            EQU        1
  154. kBSStoreGetAllStores            EQU        2
  155. kBSStoreGetPrimaryStores        EQU        3
  156. ; typedef UInt32                         BSStoreGetSelector
  157.  
  158. ;
  159. ;****************************************************************************
  160. ;
  161. ;    Format specifiers - these are generic categories.  There may be further
  162. ;        distinctions within these categories for number of blocks, etc.
  163. ;    
  164. ; ***************************************************************************
  165. ;
  166.  
  167. kBSFormatFloppyGCR                EQU        'gcr '
  168. kBSFormatFloppyMFM                EQU        'mfm '
  169. kBSFormatSCSI                    EQU        'scsi'
  170. kBSFormatATA                    EQU        'ata '
  171. kBSNotFormatable                EQU        'none'
  172. ; typedef OSType                         BSStoreFormatType
  173.  
  174.  
  175. kBSMaxFormats                    EQU        8
  176. ;  Maximum number of formats a Mapping plug-in can support 
  177. ;
  178. ;****************************************************************************
  179. ; *****************************************************************************
  180. ; *****************************************************************************
  181. ;
  182. ;    Block Storage Error codes
  183. ;    
  184. ; *****************************************************************************
  185. ; *****************************************************************************
  186. ; ***************************************************************************
  187. ;
  188. ;
  189. ;****************************************************************************
  190. ;
  191. ;    Basic error types
  192. ;    
  193. ; ***************************************************************************
  194. ;
  195.  
  196. E_Success                        EQU        $00000000
  197. E_LoopTermination                EQU        $08000000
  198. E_Underflow                        EQU        $10000000
  199. E_Overflow                        EQU        $18000000
  200. E_AlreadyExists                    EQU        $20000000
  201. E_NotFound                        EQU        $28000000
  202. E_AccessViolation                EQU        $30000000
  203. E_Busy                            EQU        $38000000
  204. E_VersionMismatch                EQU        $40000000
  205. E_Canceled                        EQU        $48000000
  206. E_OutOfResources                EQU        $50000000
  207. E_Timeout                        EQU        $58000000
  208. E_ParameterError                EQU        $60000000
  209. E_Fatal                            EQU        $68000000
  210. E_Unknown                        EQU        $F8000000
  211. ;
  212. ;****************************************************************************
  213. ;
  214. ;    Block Storage Error ID
  215. ;    
  216. ; ***************************************************************************
  217. ;
  218.  
  219. E_BlockStorageBias                EQU        $04F00000
  220. ;
  221. ;****************************************************************************
  222. ;
  223. ;    Block Storage Error Categories
  224. ;    
  225. ; ***************************************************************************
  226. ;
  227.  
  228. E_BSFamilyError                    EQU        $04F00000
  229. E_BSExpertError                    EQU        $04F08000
  230. E_BSMappingPlugInError            EQU        $04F10000
  231. E_BSPartitioningPlugInError        EQU        $04F18000
  232. E_BSContainerPlugInError        EQU        $04F20000
  233. E_BSBlockListError                EQU        $04F28000
  234. E_BSSuccess                        EQU        $00000000
  235. ;
  236. ;****************************************************************************
  237. ;
  238. ;    Family Errors
  239. ;    
  240. ; ***************************************************************************
  241. ;
  242.  
  243. E_BSOutOfResources                EQU        $54F00001
  244. E_BSStoreInUse                    EQU        $34F00001
  245. E_BSStoreWriteProtected            EQU        $34F00002
  246. E_BSStoreNotFound                EQU        $2CF00001
  247. E_BSBadMessage                    EQU        $64F00001
  248. E_BSBadConnection                EQU        $64F00002
  249. E_BSTableTooSmall                EQU        $64F00003
  250. E_BSNullParameters                EQU        $64F00004
  251. E_BSParameterError                EQU        $64F00005
  252. E_BSUnimplemented                EQU        $44F00001
  253. ;
  254. ;****************************************************************************
  255. ;
  256. ;    Expert Errors
  257. ;    
  258. ; ***************************************************************************
  259. ;
  260.  
  261. E_BSEPlugInNotFound                EQU        $2CF08001
  262. E_BSENoPlugInMatch                EQU        $2CF08002
  263. E_BSENoMoreStores                EQU        $54F08001
  264. E_BSEHierarchyTooDeep            EQU        $54F08002
  265. E_BSEOutOfResources                EQU        $54F08003
  266. ;
  267. ;****************************************************************************
  268. ;
  269. ;    Mapping Plug-in Errors
  270. ;    
  271. ; ***************************************************************************
  272. ;
  273.  
  274. E_BSMPIOutOfStoreBounds            EQU        $64F10001
  275. E_BSMPITooManyMappings            EQU        $64F10002
  276. E_BSMPIBadMappingParams            EQU        $64F10003
  277. E_BSMPIMappingNotSupported        EQU        $64F10004
  278. E_BSMPIStateNotSupported        EQU        $64F10005
  279. E_BSMPIWriteProtected            EQU        $34F10001
  280. E_BSMPICannotGoToState            EQU        $34F10002
  281. E_BSMPIUnitNotResponding        EQU        $6CF10001
  282. E_BSMPITransferError            EQU        $6CF10002
  283. E_BSMPIMemoryAccessFault        EQU        $6CF10003
  284. E_BSMPINoPlugIn                    EQU        $6CF10004
  285. E_BSMPIMediaRemoved                EQU        $6CF10005
  286. E_BSMPIOutOfResources            EQU        $54F10001
  287. ;
  288. ;****************************************************************************
  289. ;
  290. ;    Partitioning Plug-in Errors
  291. ;    
  292. ; ***************************************************************************
  293. ;
  294.  
  295. E_BSPPIMappingNotSupported        EQU        $64F18001
  296. E_BSPPIOverlappingPartition        EQU        $64F18002
  297. E_BSPPIOutOfStoreBounds            EQU        $64F18003
  298. E_BSPPIPartitionNonExistant        EQU        $64F18004
  299. E_BSPPITooManyPartitions        EQU        $64F18005
  300. E_BSPPINoPlugIn                    EQU        $6CF18001
  301. E_BSPPIOutOfResources            EQU        $54F18002
  302. ;
  303. ;****************************************************************************
  304. ;
  305. ;    Container Plug-in Errors
  306. ;    
  307. ; ***************************************************************************
  308. ;
  309. ;
  310. ;****************************************************************************
  311. ;
  312. ;    Block List Errors
  313. ;    
  314. ; ***************************************************************************
  315. ;
  316.  
  317. E_BSBLEndOfList                    EQU        $14F28001
  318. E_BSBLParameterError            EQU        $64F28001
  319. E_BSBLBadBlockList                EQU        $64F28002
  320. E_BSBLBadBlock                    EQU        $64F28003
  321. E_BSBLAlreadyFinalized            EQU        $24F28001
  322. E_BSBLOutOfResources            EQU        $54F28001
  323. ;
  324. ;****************************************************************************
  325. ; *****************************************************************************
  326. ; *****************************************************************************
  327. ;
  328. ; Block Storage Types and Structures
  329. ; *****************************************************************************
  330. ; *****************************************************************************
  331. ; ***************************************************************************
  332. ;
  333. ;
  334. ;****************************************************************************
  335. ;
  336. ;    Store and Container Persistent Identifiers
  337. ;    
  338. ; ***************************************************************************
  339. ;
  340. BSStoreID                RECORD 0
  341. elements                 ds.b    12
  342. sizeof                     EQU *                    ; size:   $C (12)
  343.                         ENDR
  344.  
  345.  
  346. BSContainerID            RECORD 0
  347. elements                 ds.b    12
  348. sizeof                     EQU *                    ; size:   $C (12)
  349.                         ENDR
  350.  
  351.  
  352. ;
  353. ;****************************************************************************
  354. ;
  355. ;    Connection ID's
  356. ;    
  357. ; ***************************************************************************
  358. ;
  359. ; typedef ObjectID                         BSContainerConnID
  360.  
  361. ; typedef ObjectID                         BSStoreConnID
  362.  
  363. ;
  364. ;****************************************************************************
  365. ;
  366. ;    Plug-in run-time references.  References the plug-in in general, not
  367. ;        a specific instance of it
  368. ;    
  369. ; ***************************************************************************
  370. ;
  371.  
  372.  
  373.  
  374.  
  375.  
  376.  
  377. ;
  378. ;****************************************************************************
  379. ;
  380. ;    Store and Container Run-Time References
  381. ;    
  382. ; ***************************************************************************
  383. ;
  384. BSStoreRef                RECORD 0
  385. f                         ds        RegEntryRef
  386. sizeof                     EQU *                    ; size:   $10 (16)
  387.                         ENDR
  388.  
  389.  
  390. BSContainerRef            RECORD 0
  391. f                         ds        RegEntryRef
  392. sizeof                     EQU *                    ; size:   $10 (16)
  393.                         ENDR
  394.  
  395.  
  396. ;
  397. ;****************************************************************************
  398. ;
  399. ;    Store and Container Navigation API types
  400. ;    
  401. ; ***************************************************************************
  402. ;
  403. ; typedef ObjectID                         BSStoreIteratorID
  404.  
  405. ; typedef ObjectID                         BSContainerIteratorID
  406.  
  407. ; typedef RegPropertyInstance             BSStorePropertyInstance
  408.  
  409. ; typedef RegPropertyInstance             BSContainerPropertyInstance
  410.  
  411. ;
  412. ;****************************************************************************
  413. ;
  414. ;    Device block descriptor types
  415. ;    
  416. ; ***************************************************************************
  417. ;
  418. BSByteCount                RECORD 0
  419. f                         ds        UInt64
  420. sizeof                     EQU *                    ; size:   $8 (8)
  421.                         ENDR
  422.  
  423.  
  424.  
  425.  
  426.  
  427.  
  428. ;
  429. ;******************************************************************************
  430. ;
  431. ;    BSBlockListDescriptorInfo - information about a Block List Descriptor
  432. ;    
  433. ; *****************************************************************************
  434. ;
  435. BSBlockListDescriptorInfo RECORD 0
  436. bias                     ds        BSByteCount        ; offset: $0 (0)
  437. start                     ds        BSByteCount        ; offset: $8 (8)
  438. length                     ds.l    1                ; offset: $10 (16)
  439. parentDescriptor         ds.l    1                ; offset: $14 (20)
  440. parentList                 ds.l    1                ; offset: $18 (24)
  441. sizeof                     EQU *                    ; size:   $1C (28)
  442.                         ENDR
  443. ; typedef struct BSBlockListDescriptorInfo * BSBlockListDescriptorInfoPtr
  444.  
  445. ;
  446. ;****************************************************************************
  447. ;
  448. ;    BSStoreFormatInfo
  449. ;    
  450. ; ***************************************************************************
  451. ;
  452. ; typedef ItemCount                     BSFormatIndex
  453.  
  454. BSStoreFormatInfo        RECORD 0
  455. formatType                 ds.l    1                ; offset: $0 (0)
  456. formatSize                 ds        BSByteCount        ; offset: $4 (4)
  457. formatNum                 ds.l    1                ; offset: $C (12)        ;  Format identifier - specific to Mapping plug-in 
  458. sizeof                     EQU *                    ; size:   $10 (16)
  459.                         ENDR
  460. ;
  461. ;****************************************************************************
  462. ;
  463. ;    BSStoreInfo is used to return information about a Store
  464. ;    
  465. ; ***************************************************************************
  466. ;
  467. BSStoreInfo                RECORD 0
  468. storeID                     ds        BSStoreID        ; offset: $0 (0)
  469. storeSize                 ds        BSByteCount        ; offset: $C (12)
  470. readBlockSize             ds        BSByteCount        ; offset: $14 (20)        ;  minimum read size & granularity 
  471. writeBlockSize             ds        BSByteCount        ; offset: $1C (28)        ;  minimum write size & granularity 
  472. container                 ds        BSContainerRef ; offset: $24 (36)        ;  the container containing this Store 
  473. numChildren                 ds.l    1                ; offset: $34 (52)
  474. numParents                 ds.l    1                ; offset: $38 (56)
  475. numPartitions             ds.l    1                ; offset: $3C (60)        ;  Number of partitions in use 
  476. maxPartitions             ds.l    1                ; offset: $40 (64)        ;  Maximum number of partitions possible 
  477. isPartitioned             ds.b    1                ; offset: $44 (68)        ;  True if a partitioning plug-in is associated with this Store 
  478. isEjectable                 ds.b    1                ; offset: $45 (69)
  479. isBootDevice             ds.b    1                ; offset: $46 (70)
  480. isWriteable                 ds.b    1                ; offset: $47 (71)
  481. hasAutoEjectHardware     ds.b    1                ; offset: $48 (72)
  482. isFormattable             ds.b    1                ; offset: $49 (73)
  483. isPartitionable             ds.b    1                ; offset: $4A (74)
  484. isFilesystem             ds.b    1                ; offset: $4B (75)
  485. mappingPlugIn             ds.l    1                ; offset: $4C (76)
  486. partitioningPlugIn         ds.l    1                ; offset: $50 (80)
  487. curFormat                 ds        BSStoreFormatInfo ; offset: $54 (84)
  488. possibleFormats             ds.b    8 * BSStoreFormatInfo.sizeof ; offset: $64 (100)
  489. name                     ds        Str255            ; offset: $E4 (228)        ;  Max name size is 255 (0 terminated) 
  490. typeName                 ds        Str32            ; offset: $1E4 (484)    ;  Max type name is 32 (0 terminated) 
  491.                          ORG 518
  492. sizeof                     EQU *                    ; size:   $206 (518)
  493.                         ENDR
  494. ; typedef struct BSStoreInfo *            BSStoreInfoPtr
  495.  
  496. ;
  497. ;****************************************************************************
  498. ;
  499. ;    BSContainerInfo is used to return information about a Container
  500. ;    
  501. ; ***************************************************************************
  502. ;
  503. BSContainerInfo            RECORD 0
  504. device                     ds        RegEntryRef        ; offset: $0 (0)
  505. numChildren                 ds.l    1                ; offset: $10 (16)
  506. ejectable                 ds.b    1                ; offset: $14 (20)
  507.                          ORG 22
  508. sizeof                     EQU *                    ; size:   $16 (22)
  509.                         ENDR
  510. ; typedef struct BSContainerInfo *        BSContainerInfoPtr
  511.  
  512. ;
  513. ;****************************************************************************
  514. ;
  515. ;    BSPartitionInfo is used to return information about a Partition
  516. ;    
  517. ; ***************************************************************************
  518. ;
  519. BSPartitionDescriptor    RECORD 0
  520. entryNum                 ds.l    1                ; offset: $0 (0)
  521. start                     ds        BSByteCount        ; offset: $4 (4)
  522. len                         ds        BSByteCount        ; offset: $C (12)
  523. destStoreID                 ds        BSStoreID        ; offset: $14 (20)
  524. isPartitionable             ds.b    1                ; offset: $20 (32)
  525. isFilesystem             ds.b    1                ; offset: $21 (33)
  526. reserved1                 ds.b    1                ; offset: $22 (34)
  527. reserved2                 ds.b    1                ; offset: $23 (35)
  528. name                     ds        Str255            ; offset: $24 (36)        ;  Max name size is 255 (0 terminated) 
  529. typeName                 ds        Str32            ; offset: $124 (292)    ;  Max type name is 32 (0 terminated) 
  530.                          ORG 326
  531. sizeof                     EQU *                    ; size:   $146 (326)
  532.                         ENDR
  533. ; typedef struct BSPartitionDescriptor * BSPartitionDescriptorPtr
  534.  
  535. ;
  536. ;****************************************************************************
  537. ;
  538. ;    BSStoreComponent describes a component of a Store.  A component may
  539. ;    be an external device or another Store.  
  540. ;    
  541. ; ***************************************************************************
  542. ;
  543. BSStoreComponent        RECORD 0
  544. componentType             ds.l    1                ; offset: $0 (0)
  545. startingOffset             ds        BSByteCount        ; offset: $4 (4)        ;  Where in the Store this 
  546. ;  component will be placed 
  547. sourceNode                 ds        RegEntryRef        ; offset: $C (12)        ;  Physical components 
  548. srcStore                 ds        BSStoreRef        ; offset: $1C (28)        ;  Logical components 
  549. partitionInfo             ds        BSPartitionDescriptor ; offset: $2C (44) ;  Logical components 
  550.                          ORG 370
  551. sizeof                     EQU *                    ; size:   $172 (370)
  552.                         ENDR
  553. ; typedef struct BSStoreComponent *        BSStoreComponentPtr
  554.  
  555. ;
  556. ;****************************************************************************
  557. ;
  558. ; ***************************************************************************
  559. ;
  560. BSStoreIOIteratorData    RECORD 0
  561. IOCI                     ds        IOCommonInfo    ; offset: $0 (0)
  562. info                     ds        BSStoreInfo        ; offset: $14 (20)
  563.                          ORG 538
  564. sizeof                     EQU *                    ; size:   $21A (538)
  565.                         ENDR
  566. ;
  567. ;****************************************************************************
  568. ; *****************************************************************************
  569. ; *****************************************************************************
  570. ;
  571. ;    Block Storage API Functions
  572. ;    
  573. ;    These functions make up the Block Storage API.  All functions are callable
  574. ;    from the user or privileged bands.  The API is split into the following
  575. ;    sections:
  576. ;    
  577. ;        Navigation - operations to find a Store or Container and its 
  578. ;            relationship to other Stores and Containers
  579. ;            
  580. ;        Connections - operations to open and close connections with Stores and
  581. ;            Containers
  582. ;            
  583. ;        Block Lists - operations to create and manipulate Block Lists, used
  584. ;            as inputs for I/O operations
  585. ;            
  586. ;        I/O - operations to read and write date to Stores
  587. ;        
  588. ;        Accessibility - operations to change the accessibility of Store and
  589. ;            Containers.  Power-down and eject are handled via this interface
  590. ;            
  591. ;        Configuration - operations to add new devices, replace plug-ins,
  592. ;            format and partition Stores and modify the relationships of 
  593. ;            Stores and Containers to each other.
  594. ;    
  595. ; *****************************************************************************
  596. ; *****************************************************************************
  597. ; ***************************************************************************
  598. ;
  599. ;
  600. ;****************************************************************************
  601. ; *****************************************************************************
  602. ;
  603. ;    Block Storage Navigation API
  604. ;    
  605. ; *****************************************************************************
  606. ; ***************************************************************************
  607. ;
  608. ;
  609. ;******************************************************************************
  610. ;    
  611. ;    BSStoreGetDeviceData - a simple iteration model to retrieve all of the
  612. ;        Stores, the leaf Stores or the primary Stores.
  613. ;    
  614. ;    Inputs:        selector - which set of Stores to retrieve
  615. ;                    kBSStoreGetLeafStores retrieves leaf stores
  616. ;                    kBSStoreGetAllStores retrieves all stores
  617. ;                    kBSStoreGetPrimaryStores retrieves only primary stores
  618. ;                requestItemCount - the size of the buffer
  619. ;    
  620. ;    Outputs:    iteratorData - the array of BSStoreIOIteratorData structures
  621. ;                    to be filled in
  622. ;                totalItemCount - the actual number of items available (may be
  623. ;                    more than requestItemCount, though only requestItemCount
  624. ;                    structures will be filled in in iteratorData)
  625. ;    
  626. ;    Returns:    E_BSSuccess if successful
  627. ;                
  628. ;    
  629. ; *****************************************************************************
  630. ;
  631. ;
  632. ; extern OSStatus BSStoreGetDeviceData(BSStoreGetSelector selector, ItemCount requestItemCount, ItemCount *totalItemCount, BSStoreIOIteratorData *iteratorData)
  633. ;
  634.     IF GENERATINGCFM THEN
  635.         IMPORT_CFM_FUNCTION BSStoreGetDeviceData
  636.     ENDIF
  637.  
  638. ;
  639. ;******************************************************************************
  640. ;    
  641. ;    BSStoreIteratorCreate - Creates an iterator for Block Storage Stores which
  642. ;        will be initially placed on startingStore.  If starting Store is NULL
  643. ;        the iterator will be placed "in the soup" at the root of the Store
  644. ;        hierarchy
  645. ;
  646. ;    Inputs:        startingStore - the Store to begin at
  647. ;    
  648. ;    Outputs:    newIterator - the returned iterator
  649. ;    
  650. ;    Returns:    E_BSSuccess if successful
  651. ;                
  652. ;    
  653. ; *****************************************************************************
  654. ;
  655. ;
  656. ; extern OSStatus BSStoreIteratorCreate(BSStoreRef *startingStore, BSStoreIteratorID *newIterator)
  657. ;
  658.     IF GENERATINGCFM THEN
  659.         IMPORT_CFM_FUNCTION BSStoreIteratorCreate
  660.     ENDIF
  661.  
  662. ;
  663. ;******************************************************************************
  664. ;    
  665. ;    BSStoreIteratorDispose - disposes of an iterator, freeing all resources
  666. ;        associated with it
  667. ;    
  668. ;    Inputs:        disposeIterator - the iterator to dispose
  669. ;    
  670. ;    Outputs:    <none>
  671. ;    
  672. ;    Returns:    E_BSSuccess if successful
  673. ;    
  674. ; *****************************************************************************
  675. ;
  676. ;
  677. ; extern OSStatus BSStoreIteratorDispose(BSStoreIteratorID disposeIterator)
  678. ;
  679.     IF GENERATINGCFM THEN
  680.         IMPORT_CFM_FUNCTION BSStoreIteratorDispose
  681.     ENDIF
  682.  
  683. ;
  684. ;******************************************************************************
  685. ;    
  686. ;    BSStoreIteratorEnter - Moves the iterator into the child the iterator is
  687. ;        currently on, placing it on the first child
  688. ;    
  689. ;    Inputs:        iterator - the iterator to move
  690. ;    
  691. ;    Outputs:    newStore - the Store we've just exited
  692. ;    
  693. ;    Returns:    E_BSSuccessful
  694. ;    
  695. ; *****************************************************************************
  696. ;
  697. ;
  698. ; extern OSStatus BSStoreIteratorEnter(BSStoreIteratorID iterator, BSStoreRef *newStore)
  699. ;
  700.     IF GENERATINGCFM THEN
  701.         IMPORT_CFM_FUNCTION BSStoreIteratorEnter
  702.     ENDIF
  703.  
  704. ;
  705. ;******************************************************************************
  706. ;    
  707. ;    BSStoreIteratorExit - Moves the iterator into the parent the iterator is
  708. ;        currently on, placing the iterator on the Store it exited.
  709. ;    
  710. ;    Inputs:        iterator - the iterator to move
  711. ;    
  712. ;    Outputs:    newStore - the Store we've been placed on
  713. ;    
  714. ;    Returns:    E_BSSuccess if successful
  715. ;    
  716. ; *****************************************************************************
  717. ;
  718. ;
  719. ; extern OSStatus BSStoreIteratorExit(BSStoreIteratorID iterator, BSStoreRef *newStore)
  720. ;
  721.     IF GENERATINGCFM THEN
  722.         IMPORT_CFM_FUNCTION BSStoreIteratorExit
  723.     ENDIF
  724.  
  725. ;
  726. ;******************************************************************************
  727. ;    
  728. ;    BSStoreIteratorRestartChildren - Places the iterator on the first child
  729. ;        in the current Store
  730. ;    
  731. ;    Inputs:        iterator - the iterator to restart
  732. ;    
  733. ;    Outputs:    newChild - the child we've been placed on
  734. ;    
  735. ;    Returns:    E_BSSuccess if succesful
  736. ;    
  737. ; *****************************************************************************
  738. ;
  739. ;
  740. ; extern OSStatus BSStoreIteratorRestartChildren(BSStoreIteratorID iterator, BSStoreRef *newChild)
  741. ;
  742.     IF GENERATINGCFM THEN
  743.         IMPORT_CFM_FUNCTION BSStoreIteratorRestartChildren
  744.     ENDIF
  745.  
  746. ;
  747. ;******************************************************************************
  748. ;    
  749. ;    BSStoreIteratorRestartParent - Places the iterator on the first parent
  750. ;        in the current Store
  751. ;    
  752. ;    Inputs:        iterator - the iterator to restart
  753. ;    
  754. ;    Outputs:    newParent - the parent we've been placed on
  755. ;    
  756. ;    Returns:    E_BSSuccess if succesful
  757. ;    
  758. ; *****************************************************************************
  759. ;
  760. ;
  761. ; extern OSStatus BSStoreIteratorRestartParent(BSStoreIteratorID iterator, BSStoreRef *newParent)
  762. ;
  763.     IF GENERATINGCFM THEN
  764.         IMPORT_CFM_FUNCTION BSStoreIteratorRestartParent
  765.     ENDIF
  766.  
  767. ;
  768. ;******************************************************************************
  769. ;    
  770. ;    BSStoreIteratorNextChild - Moves the iterator to the next child
  771. ;    
  772. ;    Inputs:        iterator - the iterator to move
  773. ;    
  774. ;    Outputs:    newChild - the child we've been placed on
  775. ;                changed - true if a parent or child has been added or deleted
  776. ;                        to this Store since the last BSStoreIteratorNextChild or 
  777. ;                        BSStoreIteratorNextParent call
  778. ;    
  779. ;    Returns:    E_BSSuccess if successful
  780. ;    
  781. ; *****************************************************************************
  782. ;
  783. ;
  784. ; extern OSStatus BSStoreIteratorNextChild(BSStoreIteratorID iterator, BSStoreRef *newChild, Boolean *changed)
  785. ;
  786.     IF GENERATINGCFM THEN
  787.         IMPORT_CFM_FUNCTION BSStoreIteratorNextChild
  788.     ENDIF
  789.  
  790. ;
  791. ;******************************************************************************
  792. ;    
  793. ;    BSStoreIteratorNextParent - Moves the iterator to the next parent
  794. ;    
  795. ;    Inputs:        iterator - iterator to move
  796. ;                    changed - true if a parent or child has been added or deleted
  797. ;                        since the last BSStoreIteratorNextChild or 
  798. ;                        BSStoreIteratorNextParent call
  799. ;                        
  800. ;    Outputs:    newParent - the parent we've been placed on
  801. ;    
  802. ;    Returns:    E_BSSuccess if successful
  803. ;    
  804. ; *****************************************************************************
  805. ;
  806. ;
  807. ; extern OSStatus BSStoreIteratorNextParent(BSStoreIteratorID iterator, BSStoreRef *newParent, Boolean *changed)
  808. ;
  809.     IF GENERATINGCFM THEN
  810.         IMPORT_CFM_FUNCTION BSStoreIteratorNextParent
  811.     ENDIF
  812.  
  813. ;
  814. ;******************************************************************************
  815. ;    
  816. ;    BSContainerIteratorCreate - Creates an iterator for Block Storage Containers
  817. ;        which will be initially placed on startingContainer.  If starting 
  818. ;        Container is NULL the iterator will be placed "in the soup" at the root 
  819. ;        of the Container hierarchy.
  820. ;    
  821. ;    Inputs:        startingContainer - the container to start at or NULL to start
  822. ;                    at the root of the Container hierarchy
  823. ;    
  824. ;    Outputs:    newIterator - the created iterator
  825. ;    
  826. ;    Returns:    E_BSSuccess if successful
  827. ;    
  828. ; *****************************************************************************
  829. ;
  830. ;
  831. ; extern OSStatus BSContainerIteratorCreate(BSContainerRef *startingContainer, BSContainerIteratorID *newIterator)
  832. ;
  833.     IF GENERATINGCFM THEN
  834.         IMPORT_CFM_FUNCTION BSContainerIteratorCreate
  835.     ENDIF
  836.  
  837. ;
  838. ;******************************************************************************
  839. ;    
  840. ;    BSContainerIteratorDispose - disposes of an iterator, freeing all resources
  841. ;        associated with it
  842. ;    
  843. ;    Inputs:        disposeIterator - the iterator to dispose
  844. ;    
  845. ;    Outputs:    <none>
  846. ;    
  847. ;    Returns:    E_BSSuccess if successful
  848. ;    
  849. ; *****************************************************************************
  850. ;
  851. ;
  852. ; extern OSStatus BSContainerIteratorDispose(BSContainerIteratorID disposeIterator)
  853. ;
  854.     IF GENERATINGCFM THEN
  855.         IMPORT_CFM_FUNCTION BSContainerIteratorDispose
  856.     ENDIF
  857.  
  858. ;
  859. ;******************************************************************************
  860. ;    
  861. ;    BSContainerIteratorEnter - Moves the iterator into the child the iterator is
  862. ;        currently on, placing it on the first child
  863. ;    
  864. ;    Inputs:        iterator - the iterator to move
  865. ;    
  866. ;    Outputs:    newContainer - the Container we've been placed on
  867. ;    
  868. ;    Returns:    E_BSSuccess if successful
  869. ;    
  870. ; *****************************************************************************
  871. ;
  872. ;
  873. ; extern OSStatus BSContainerIteratorEnter(BSContainerIteratorID iterator, BSContainerRef *newContainer)
  874. ;
  875.     IF GENERATINGCFM THEN
  876.         IMPORT_CFM_FUNCTION BSContainerIteratorEnter
  877.     ENDIF
  878.  
  879. ;
  880. ;******************************************************************************
  881. ;    
  882. ;    BSContainerIteratorExit - exits to the parent of the current Container,
  883. ;        placing the iterator on the Container it exited.  (Containers may have
  884. ;        only one parent)
  885. ;    
  886. ;    Inputs:        iterator - the iterator to move
  887. ;    
  888. ;    Outputs:    newContainer - the Container we've just exited
  889. ;    
  890. ;    Returns:    E_BSSuccess if successful
  891. ;    
  892. ; *****************************************************************************
  893. ;
  894. ;
  895. ; extern OSStatus BSContainerIteratorExit(BSContainerIteratorID iterator, BSContainerRef *newContainer)
  896. ;
  897.     IF GENERATINGCFM THEN
  898.         IMPORT_CFM_FUNCTION BSContainerIteratorExit
  899.     ENDIF
  900.  
  901. ;
  902. ;******************************************************************************
  903. ;    
  904. ;    BSContainerIteratorRestartChildren - Places the iterator on the first child 
  905. ;        in the current Container
  906. ;    
  907. ;    Inputs:        iterator - the iterator to restart
  908. ;    
  909. ;    Outputs:    newChild - the child we've been placed on
  910. ;    
  911. ;    Returns:    E_BSSuccess if succesful    
  912. ;    
  913. ; *****************************************************************************
  914. ;
  915. ;
  916. ; extern OSStatus BSContainerIteratorRestartChildren(BSContainerIteratorID iterator, BSContainerRef *newChild)
  917. ;
  918.     IF GENERATINGCFM THEN
  919.         IMPORT_CFM_FUNCTION BSContainerIteratorRestartChildren
  920.     ENDIF
  921.  
  922. ;
  923. ;******************************************************************************
  924. ;    
  925. ;    BSContainerIteratorNextChild - Moves the iterator to the next child
  926. ;    
  927. ;    Inputs:        iterator - the iterator to move
  928. ;    
  929. ;    Outputs:    newChild - the child we've been placed on
  930. ;                changed - true if a child has been added or deleted to this 
  931. ;                Container since the last BSContainerIteratorNextChild.
  932. ;    
  933. ;    Returns:    E_BSSuccess if successful    
  934. ;    
  935. ; *****************************************************************************
  936. ;
  937. ;
  938. ; extern OSStatus BSContainerIteratorNextChild(BSContainerIteratorID iterator, BSContainerRef *newChild)
  939. ;
  940.     IF GENERATINGCFM THEN
  941.         IMPORT_CFM_FUNCTION BSContainerIteratorNextChild
  942.     ENDIF
  943.  
  944. ;
  945. ;******************************************************************************
  946. ;    
  947. ;    BSStoreFindByID - finds a Store by its identifier and returns a ref
  948. ;    
  949. ;    Inputs:        storeID - the Store ID to find
  950. ;    
  951. ;    Outputs:    foundStore - the found reference
  952. ;    
  953. ;    Returns:    E_BSSuccess if successful
  954. ;    
  955. ; *****************************************************************************
  956. ;
  957. ;
  958. ; extern OSStatus BSStoreFindByID(BSStoreID storeID, BSStoreRef *foundStore)
  959. ;
  960.     IF GENERATINGCFM THEN
  961.         IMPORT_CFM_FUNCTION BSStoreFindByID
  962.     ENDIF
  963.  
  964. ;
  965. ;******************************************************************************
  966. ;    
  967. ;    BSStoreGetPropertySize - retrieves the size of the named property from the 
  968. ;                Store.
  969. ;    
  970. ;    Inputs:        store - the Store to retrieve the property from
  971. ;                propertyName - the name of the property to retrieve the size of
  972. ;                propertyInstance - the instance of the property within this Store
  973. ;    
  974. ;    Outputs:    propertySize - filled in with the size of the property
  975. ;    
  976. ;    Returns:    E_BSSuccess if successful
  977. ;    
  978. ; *****************************************************************************
  979. ;
  980. ;
  981. ; extern OSStatus BSStoreGetPropertySize(BSStoreRef *store, char *propertyName, BSStorePropertyInstance propertyInstance, ByteCount *propertySize)
  982. ;
  983.     IF GENERATINGCFM THEN
  984.         IMPORT_CFM_FUNCTION BSStoreGetPropertySize
  985.     ENDIF
  986.  
  987. ;
  988. ;******************************************************************************
  989. ;    
  990. ;    BSStoreGetProperty - retrieves the named property from the Store.
  991. ;    
  992. ;    Inputs:        store - the Store to retrieve the property from
  993. ;                propertyName - the name of the property to retrieve the size of
  994. ;                propertyInstance - the instance of the property within this Store
  995. ;                propertySize - the size of the buffer passed in (on input)
  996. ;                
  997. ;    Outputs:    propertyValue - a pointer to the buffer to be filled in
  998. ;                propertySize - the size filled in (on exit)
  999. ;    
  1000. ;    Returns:    E_BSSuccess if successful
  1001. ;    
  1002. ; *****************************************************************************
  1003. ;
  1004. ;
  1005. ; extern OSStatus BSStoreGetProperty(BSStoreRef *store, char *propertyName, BSStorePropertyInstance propertyInstance, void *propertyValue, ByteCount *propertySize)
  1006. ;
  1007.     IF GENERATINGCFM THEN
  1008.         IMPORT_CFM_FUNCTION BSStoreGetProperty
  1009.     ENDIF
  1010.  
  1011. ;
  1012. ;******************************************************************************
  1013. ;    
  1014. ;    BSContainerGetPropertySize - retrieves the size of the named property from 
  1015. ;                the Container.
  1016. ;    
  1017. ;    Inputs:        container - the Container to retrieve the property from
  1018. ;                propertyName - the name of the property to retrieve the size of
  1019. ;                propertyInstance - the instance of the property within this Store
  1020. ;    
  1021. ;    Outputs:    propertySize - filled in with the size of the property
  1022. ;    
  1023. ;    Returns:    E_BSSuccess if successful
  1024. ;    
  1025. ; *****************************************************************************
  1026. ;
  1027. ;
  1028. ; extern OSStatus BSContainerGetPropertySize(BSContainerRef *container, char *propertyName, BSContainerPropertyInstance propertyInstance, ByteCount *propertySize)
  1029. ;
  1030.     IF GENERATINGCFM THEN
  1031.         IMPORT_CFM_FUNCTION BSContainerGetPropertySize
  1032.     ENDIF
  1033.  
  1034. ;
  1035. ;******************************************************************************
  1036. ;    
  1037. ;    BSContainerGetProperty - retrieves the named property from the Container.
  1038. ;    
  1039. ;    Inputs:        container - the Container to retrieve the property from
  1040. ;                propertyName - the name of the property to retrieve the size of
  1041. ;                propertyInstance - the instance of the property within this 
  1042. ;                    Container
  1043. ;                propertySize - the size of the buffer passed in (on input)
  1044. ;                
  1045. ;    Outputs:    propertyValue - a pointer to the buffer to be filled in
  1046. ;                propertySize - the size filled in (on exit)
  1047. ;    
  1048. ;    Returns:    E_BSSuccess if successful
  1049. ;
  1050. ; *****************************************************************************
  1051. ;
  1052. ;
  1053. ; extern OSStatus BSContainerGetProperty(BSContainerRef *container, char *propertyName, BSContainerPropertyInstance propertyInstance, ByteCount *propertySize)
  1054. ;
  1055.     IF GENERATINGCFM THEN
  1056.         IMPORT_CFM_FUNCTION BSContainerGetProperty
  1057.     ENDIF
  1058.  
  1059. ;
  1060. ;****************************************************************************
  1061. ; *****************************************************************************
  1062. ;
  1063. ;    Block Storage Connection Operations
  1064. ;    
  1065. ; *****************************************************************************
  1066. ; ***************************************************************************
  1067. ;
  1068. ;
  1069. ;******************************************************************************
  1070. ;
  1071. ;    BSStoreOpen - Opens a Connection to a Store
  1072. ;
  1073. ;    Inputs:        store    - the Store to be opened
  1074. ;                options    - options to the connection
  1075. ;
  1076. ;    Outputs:     newConnection    - the created connection if successful
  1077. ;
  1078. ;    Returns:    E_BSSuccess on success
  1079. ;                E_BSOutOfResources if resources for the connection cannot be allocated
  1080. ;                E_BSStoreInUse if the Store has an exclusive connection or if an
  1081. ;                    exclusive connection was requested to a Store with any connections
  1082. ;                    open.
  1083. ;                E_BSStoreWriteProtected if Write access was requested to a read only
  1084. ;                    Store
  1085. ;                E_BSStoreNotFound if store did not match any existing Stores
  1086. ;
  1087. ; *****************************************************************************
  1088. ;
  1089. ;
  1090. ; extern OSStatus BSStoreOpen(BSStoreRef *store, BSStoreOpenOptions options, BSStoreConnID *newConnection)
  1091. ;
  1092.     IF GENERATINGCFM THEN
  1093.         IMPORT_CFM_FUNCTION BSStoreOpen
  1094.     ENDIF
  1095.  
  1096. ;
  1097. ;******************************************************************************
  1098. ;
  1099. ;    BSStoreConnClose - closes a Connection to a Store
  1100. ;
  1101. ;    Inputs:        connection - the connection to be closed
  1102. ;
  1103. ;    Outputs:    <none>
  1104. ;
  1105. ;    Returns:    E_BSSuccess if successful
  1106. ;                E_BSBadConnection if the connection ID has problems
  1107. ;
  1108. ; *****************************************************************************
  1109. ;
  1110. ;
  1111. ; extern OSStatus BSStoreConnClose(BSStoreConnID connection)
  1112. ;
  1113.     IF GENERATINGCFM THEN
  1114.         IMPORT_CFM_FUNCTION BSStoreConnClose
  1115.     ENDIF
  1116.  
  1117. ;
  1118. ;******************************************************************************
  1119. ;
  1120. ;    BSContainerOpen - Opens a Connection to a Container
  1121. ;
  1122. ;    Inputs:        container    - the Container to be opened
  1123. ;                options    - options to the connection
  1124. ;
  1125. ;    Outputs:     newConnection    - the created connection if successful
  1126. ;
  1127. ;    Returns:    E_BSSuccess on success
  1128. ;                E_BSOutOfResources if resources for the connection cannot be allocated
  1129. ;                E_BSContainerInUse if the Container has an exclusive connection or if an
  1130. ;                    exclusive connection was requested to a Container with any connections
  1131. ;                    open.
  1132. ;                E_BSContainerNotFound if container did not match any existing Containers
  1133. ;
  1134. ; *****************************************************************************
  1135. ;
  1136. ;
  1137. ; extern OSStatus BSContainerOpen(BSContainerRef *container, BSContainerOpenOptions options, BSContainerConnID *newConnection)
  1138. ;
  1139.     IF GENERATINGCFM THEN
  1140.         IMPORT_CFM_FUNCTION BSContainerOpen
  1141.     ENDIF
  1142.  
  1143. ;
  1144. ;******************************************************************************
  1145. ;
  1146. ;    BSContainerConnClose - closes a Connection to a Container
  1147. ;
  1148. ;    Inputs:        connection - the connection to be closed
  1149. ;
  1150. ;    Outputs:    <none>
  1151. ;
  1152. ;    Returns:    E_BSSuccess if successful
  1153. ;                E_BSBadConnection if the connection ID has problems
  1154. ;
  1155. ; *****************************************************************************
  1156. ;
  1157. ;
  1158. ; extern OSStatus BSContainerConnClose(BSContainerConnID connection)
  1159. ;
  1160.     IF GENERATINGCFM THEN
  1161.         IMPORT_CFM_FUNCTION BSContainerConnClose
  1162.     ENDIF
  1163.  
  1164. ;
  1165. ;****************************************************************************
  1166. ; *****************************************************************************
  1167. ;    Block Storage Block List Operations
  1168. ;    
  1169. ; *****************************************************************************
  1170. ; ***************************************************************************
  1171. ;
  1172. ;
  1173. ;******************************************************************************
  1174. ;    
  1175. ;    BSBlockListCreate - Creates a block list for use with Block Storage
  1176. ;    
  1177. ;    Inputs:        numAnticipatedRange - the number of ranges expected
  1178. ;    
  1179. ;    Outputs:    newList - the new list to which ranges may be added
  1180. ;    
  1181. ;    Returns:    E_BSSuccess if successful
  1182. ;    
  1183. ; *****************************************************************************
  1184. ;
  1185. ;
  1186. ; extern OSStatus BSBlockListCreate(ItemCount numAnticipatedRanges, BSBlockListRef *newList)
  1187. ;
  1188.     IF GENERATINGCFM THEN
  1189.         IMPORT_CFM_FUNCTION BSBlockListCreate
  1190.     ENDIF
  1191.  
  1192. ;
  1193. ;******************************************************************************
  1194. ;    
  1195. ;    BSBlockListAddRange - Appends a new range to an existing block list
  1196. ;    
  1197. ;    Inputs:        appendList - the list to add the new range to
  1198. ;                startingOffset - the offset, in bytes on the device of the
  1199. ;                    start of the range
  1200. ;                length - the length, in bytes, of the range
  1201. ;    
  1202. ;    Outputs:    <none>
  1203. ;    
  1204. ;    Returns:    E_BSSuccess if successful
  1205. ;    
  1206. ; *****************************************************************************
  1207. ;
  1208. ;
  1209. ; extern OSStatus BSBlockListAddRange(BSBlockListRef appendList, BSByteCount startingOffset, ByteCount length)
  1210. ;
  1211.     IF GENERATINGCFM THEN
  1212.         IMPORT_CFM_FUNCTION BSBlockListAddRange
  1213.     ENDIF
  1214.  
  1215. ;
  1216. ;******************************************************************************
  1217. ;    
  1218. ;    BSBlockListFinalize - creates a descriptor to be used in a Block Storage
  1219. ;        read or write call from the memory list.  After this call has been made
  1220. ;        no more ranges may be added to the list.
  1221. ;    
  1222. ;    Inputs:        finalizeList - the list to be finalized
  1223. ;    
  1224. ;    Outputs:    newDescriptor - the descriptor, to be used in a read/write call
  1225. ;    
  1226. ;    Returns:    E_BSSuccess if successful
  1227. ;    
  1228. ; *****************************************************************************
  1229. ;
  1230. ;
  1231. ; extern OSStatus BSBlockListFinalize(BSBlockListRef finalizeList, BSBlockListDescriptorRef *newDescriptor)
  1232. ;
  1233.     IF GENERATINGCFM THEN
  1234.         IMPORT_CFM_FUNCTION BSBlockListFinalize
  1235.     ENDIF
  1236.  
  1237. ;
  1238. ;******************************************************************************
  1239. ;
  1240. ;    BSBlockListDelete - Removes a Block List.  All resources
  1241. ;        associated with this Block List are relinquished.  This includes memory
  1242. ;        which was prepared for any of its descriptors.  All descriptors are
  1243. ;        invalidated.  This call should only be used to clean-up Block Lists
  1244. ;        in an abort condition.  In normal usage, use BSBlockListDescriptorDelete
  1245. ;        to remove all descriptors and free the Block List.
  1246. ;
  1247. ;    Inputs:        deleteList - the descriptor to delete
  1248. ;
  1249. ;    Outputs:    <none>
  1250. ;
  1251. ;    Returns:    E_BSSuccess if successful
  1252. ;
  1253. ; *****************************************************************************
  1254. ;
  1255. ;
  1256. ; extern OSStatus BSBlockListDelete(BSBlockListRef deleteList)
  1257. ;
  1258.     IF GENERATINGCFM THEN
  1259.         IMPORT_CFM_FUNCTION BSBlockListDelete
  1260.     ENDIF
  1261.  
  1262. ;
  1263. ;******************************************************************************
  1264. ;
  1265. ;    BSBlockListDescriptorDelete - Removes a Block List Descriptor.  All resources
  1266. ;        associated with this descriptor are relinquished.  This includes memory
  1267. ;        which was prepared for this descriptor.  If this was the last descriptor
  1268. ;        for a BlockList the BlockList is free'd also.
  1269. ;
  1270. ;    Inputs:        deleteDescriptor - the descriptor to delete
  1271. ;
  1272. ;    Outputs:    <none>
  1273. ;
  1274. ;    Returns:    E_BSSuccess if successful
  1275. ;
  1276. ; *****************************************************************************
  1277. ;
  1278. ;
  1279. ; extern OSStatus BSBlockListDescriptorDelete(BSBlockListDescriptorRef deleteDescriptor)
  1280. ;
  1281.     IF GENERATINGCFM THEN
  1282.         IMPORT_CFM_FUNCTION BSBlockListDescriptorDelete
  1283.     ENDIF
  1284.  
  1285. ;
  1286. ;******************************************************************************
  1287. ;
  1288. ;    BSBlockListDescriptorSeek - Changes the offset within the Block List descriptor
  1289. ;
  1290. ;    Inputs:        seekDescriptor - the descriptor to seek within
  1291. ;                whence - how to seek
  1292. ;                offset - where to seek
  1293. ;
  1294. ;    Outputs:    newOffset - what the current offset is now
  1295. ;
  1296. ;    Returns:    E_BSSuccess if successful
  1297. ;
  1298. ; *****************************************************************************
  1299. ;
  1300. ;
  1301. ; extern OSStatus BSBlockListDescriptorSeek(BSBlockListDescriptorRef seekDescriptor, BSBlockListWhence whence, SInt64 offset, BSByteCount *newOffset)
  1302. ;
  1303.     IF GENERATINGCFM THEN
  1304.         IMPORT_CFM_FUNCTION BSBlockListDescriptorSeek
  1305.     ENDIF
  1306.  
  1307. ;
  1308. ;******************************************************************************
  1309. ;
  1310. ;    BSBlockListGetExtent - Gets an extent at the current offset for up to the
  1311. ;        specified length
  1312. ;
  1313. ;    Inputs:        srcDesriptor - the descriptor to get the extent from
  1314. ;                requestedLen - how long an extent to try to get
  1315. ;
  1316. ;    Outputs:    startingByte - the starting byte address in the device of the
  1317. ;                    extent
  1318. ;                extentLen - how long an extent within the descriptor was found
  1319. ;
  1320. ;    Returns:    E_BSSuccess if successful
  1321. ;
  1322. ; *****************************************************************************
  1323. ;
  1324. ;
  1325. ; extern OSStatus BSBlockListDescriptorGetExtent(BSBlockListDescriptorRef srcDescriptor, ByteCount requestedLen, BSByteCount *startingByte, ByteCount *extentLen)
  1326. ;
  1327.     IF GENERATINGCFM THEN
  1328.         IMPORT_CFM_FUNCTION BSBlockListDescriptorGetExtent
  1329.     ENDIF
  1330.  
  1331. ;
  1332. ;******************************************************************************
  1333. ;
  1334. ;    BSBlockListAddSimpleDescriptor - adds a new descriptor to a block list.  The
  1335. ;        new descriptor begins at the current offset of the srcDescriptor.  The
  1336. ;        offset of the srcDescriptor is updated to point at the first byte after
  1337. ;        the end of the new descriptor.
  1338. ;
  1339. ;    Inputs:        srcDescriptor - the descriptor to base the new descriptor upon
  1340. ;                length - how much the new descriptor should cover
  1341. ;                bias - the bias offset to be applied to the block address of
  1342. ;                    srcDescriptor.  When addresses are retrieve from newDescriptor
  1343. ;                    bias will be added.
  1344. ;
  1345. ;    Outputs:    newDescriptor - the new descriptor
  1346. ;
  1347. ;    Returns:    E_BSSucess if successful
  1348. ;
  1349. ; *****************************************************************************
  1350. ;
  1351. ;
  1352. ; extern OSStatus BSBlockListAddSimpleDescriptor(BSBlockListDescriptorRef srcDescriptor, BSByteCount length, BSByteCount bias, BSBlockListDescriptorRef *newDescriptor)
  1353. ;
  1354.     IF GENERATINGCFM THEN
  1355.         IMPORT_CFM_FUNCTION BSBlockListAddSimpleDescriptor
  1356.     ENDIF
  1357.  
  1358. ;
  1359. ;******************************************************************************
  1360. ;
  1361. ;    BSBlockListDescriptorGetInfo - returns information about the specified
  1362. ;                descriptor
  1363. ;
  1364. ;    Inputs:        infoDescriptor - the descriptor to get information about
  1365. ;
  1366. ;    Outputs:    info - the information
  1367. ;
  1368. ;    Returns:    E_BSSuccess if successful
  1369. ;
  1370. ; *****************************************************************************
  1371. ;
  1372. ;
  1373. ; extern OSStatus BSBlockListDescriptorGetInfo(BSBlockListDescriptorRef infoDescriptor, BSBlockListDescriptorInfo *info)
  1374. ;
  1375.     IF GENERATINGCFM THEN
  1376.         IMPORT_CFM_FUNCTION BSBlockListDescriptorGetInfo
  1377.     ENDIF
  1378.  
  1379. ;
  1380. ;******************************************************************************
  1381. ;
  1382. ;    BSBlockListDescriptorCheckBlockSizes - checks the extents specified by the
  1383. ;        descriptor and ensures that all start at 0 mod blockSize and are 
  1384. ;        0 mod blockSize in length.   
  1385. ;
  1386. ;    Inputs:        checkDescriptor - the descriptor to check
  1387. ;                blockSize - the block size to check for
  1388. ;                
  1389. ;    Outputs:    <none>
  1390. ;
  1391. ;    Returns:    E_BSSuccess if successful
  1392. ;                E_BSBlockListBadBlockSize if any extents are mis-aligned
  1393. ;
  1394. ; *****************************************************************************
  1395. ;
  1396. ;
  1397. ; extern OSStatus BSBlockListDescriptorCheckBlockSizes(BSBlockListDescriptorRef checkDescriptor, UInt32 blockSize)
  1398. ;
  1399.     IF GENERATINGCFM THEN
  1400.         IMPORT_CFM_FUNCTION BSBlockListDescriptorCheckBlockSizes
  1401.     ENDIF
  1402.  
  1403. ;
  1404. ;******************************************************************************
  1405. ;
  1406. ;    BSBlockListDescriptorCheckBounds - checks the extents specified by the
  1407. ;        descriptor and ensures that none specify addresses beyond bound
  1408. ;
  1409. ;    Inputs:        checkDescriptor - the descriptor to check
  1410. ;                bound - the highest allowable address
  1411. ;                
  1412. ;    Outputs:    <none>
  1413. ;
  1414. ;    Returns:    E_BSSuccess if successful
  1415. ;                E_BSBlockListBadBlockSize if any extents are mis-aligned
  1416. ;
  1417. ; *****************************************************************************
  1418. ;
  1419. ;
  1420. ; extern OSStatus BSBlockListDescriptorCheckBounds(BSBlockListDescriptorRef checkDescriptor, BSByteCount bound)
  1421. ;
  1422.     IF GENERATINGCFM THEN
  1423.         IMPORT_CFM_FUNCTION BSBlockListDescriptorCheckBounds
  1424.     ENDIF
  1425.  
  1426. ;
  1427. ;****************************************************************************
  1428. ; *****************************************************************************
  1429. ;
  1430. ;    Block Storage I/O Operations
  1431. ;    
  1432. ; *****************************************************************************
  1433. ; ***************************************************************************
  1434. ;
  1435. ;
  1436. ;******************************************************************************
  1437. ;
  1438. ;    BSStoreConnRead - reads data from the Store indicated by the Connection.
  1439. ;        This is the simple version of the call, taking only a single range
  1440. ;
  1441. ;    Inputs:        readConnection - the connection to the Store to be read from
  1442. ;                startingOffset - the 64-bit offset into the device to start the
  1443. ;                        read at
  1444. ;                bytesToRead - the 32-bit, unsigned, number of bytes to read
  1445. ;                
  1446. ;    Outputs:    buffer - filled in with the bytes read
  1447. ;
  1448. ;    Returns:    E_BSSuccess if successful
  1449. ;                E_BSBadConnection if the connection ID has problems
  1450. ;                E_BSMPIOutOfStoreBounds if the request exceeds the boundaries of 
  1451. ;                    the Store
  1452. ;                E_BSMPIUnitNotResponding if the device does not respond
  1453. ;                E_BSMPITransferError if some error was detected during the transfer
  1454. ;                E_BSMPIMemoryAccessFault if the destination memory was not accessible
  1455. ;                E_BSMPIOutOfResources if a necessary resource (usually memory) could
  1456. ;                    not be allocated
  1457. ;                E_BSMPIMediaRemoved if the media was removed
  1458. ;
  1459. ; *****************************************************************************
  1460. ;
  1461. ;
  1462. ; extern OSStatus BSStoreConnRead(BSStoreConnID readConnection, BSByteCount startingOffset, ByteCount bytesToRead, void *buffer)
  1463. ;
  1464.     IF GENERATINGCFM THEN
  1465.         IMPORT_CFM_FUNCTION BSStoreConnRead
  1466.     ENDIF
  1467.  
  1468. ;
  1469. ;******************************************************************************
  1470. ;
  1471. ;    BSStoreConnWrite - writes data to the Store a Connection indicates.  This is
  1472. ;        the simple version of the call taking only a single range.
  1473. ;
  1474. ;    Inputs:        writeConnection - the connection to the Store to be read from
  1475. ;                srcMem - where the data is to be taken from
  1476. ;                destBlocks - the blocks on the Store where the data is to be placed
  1477. ;
  1478. ;    Outputs:    <none>
  1479. ;
  1480. ;    Returns:    E_BSSuccess if successful
  1481. ;            E_BSBadConnection if the connection ID has problems
  1482. ;            E_BSMPIOutOfStoreBounds if the request exceeds the boundaries of 
  1483. ;                the Store
  1484. ;            E_BSMPIUnitNotResponding if the device does not respond
  1485. ;            E_BSMPITransferError if some error was detected during the transfer
  1486. ;            E_BSMPIMemoryAccessFault if the destination memory was not accessible
  1487. ;            E_BSMPIOutOfResources if a necessary resource (usually memory) could
  1488. ;                not be allocated
  1489. ;            E_BSMPIMediaRemoved if the media was removed
  1490. ;
  1491. ; *****************************************************************************
  1492. ;
  1493. ;
  1494. ; extern OSStatus BSStoreConnWrite(BSStoreConnID writeConnection, BSByteCount startingOffset, ByteCount bytesToWrite, void *buffer)
  1495. ;
  1496.     IF GENERATINGCFM THEN
  1497.         IMPORT_CFM_FUNCTION BSStoreConnWrite
  1498.     ENDIF
  1499.  
  1500. ;
  1501. ;******************************************************************************
  1502. ;
  1503. ;    BSStoreConnReadSG - reads data from the Store indicated by the Connection.
  1504. ;        This is the scatter/gather version of the call.  The Block List is
  1505. ;        generated by the calls above, the Memory List calls can be found in
  1506. ;        <MemoryLists.h>.
  1507. ;
  1508. ;    Inputs:        readConnection - the connection to the Store to be read from
  1509. ;                srcBlocks - a descriptor indicating the ranges on the device
  1510. ;                    to be read
  1511. ;                destMemory - a Memory List descriptor indicating where the
  1512. ;                    data is to be placed
  1513. ;                    
  1514. ;    Outputs:    <none>
  1515. ;
  1516. ;    Returns:    E_BSSuccess if successful
  1517. ;                E_BSBadConnection if the connection ID has problems
  1518. ;                E_BSMPIOutOfStoreBounds if the request exceeds the boundaries of 
  1519. ;                    the Store
  1520. ;                E_BSMPIUnitNotResponding if the device does not respond
  1521. ;                E_BSMPITransferError if some error was detected during the transfer
  1522. ;                E_BSMPIMemoryAccessFault if the destination memory was not accessible
  1523. ;                E_BSMPIOutOfResources if a necessary resource (usually memory) could
  1524. ;                    not be allocated
  1525. ;                E_BSMPIMediaRemoved if the media was removed
  1526. ;
  1527. ; *****************************************************************************
  1528. ;
  1529. ;
  1530. ; extern OSStatus BSStoreConnReadSG(BSStoreConnID readConnection, BSBlockListDescriptorRef srcBlocks, MemListDescriptorRef destMemory)
  1531. ;
  1532.     IF GENERATINGCFM THEN
  1533.         IMPORT_CFM_FUNCTION BSStoreConnReadSG
  1534.     ENDIF
  1535.  
  1536. ;
  1537. ;******************************************************************************
  1538. ;
  1539. ;    BSStoreConnWriteSG - writes data to the Store a Connection indicates.  This 
  1540. ;        is the scatter/gather version of the call.  The Block List is
  1541. ;        generated by the calls above, the Memory List calls can be found in
  1542. ;        <MemoryLists.h>.
  1543. ;
  1544. ;    Inputs:        writeConnection - the connection to the Store to be read from
  1545. ;                srcMem - where the data is to be taken from
  1546. ;                destBlocks - the blocks on the Store where the data is to be placed
  1547. ;
  1548. ;    Outputs:    <none>
  1549. ;
  1550. ;    Returns:    E_BSSuccess if successful
  1551. ;            E_BSBadConnection if the connection ID has problems
  1552. ;            E_BSMPIOutOfStoreBounds if the request exceeds the boundaries of 
  1553. ;                the Store
  1554. ;            E_BSMPIUnitNotResponding if the device does not respond
  1555. ;            E_BSMPITransferError if some error was detected during the transfer
  1556. ;            E_BSMPIMemoryAccessFault if the destination memory was not accessible
  1557. ;            E_BSMPIOutOfResources if a necessary resource (usually memory) could
  1558. ;                not be allocated
  1559. ;            E_BSMPIMediaRemoved if the media was removed
  1560. ;
  1561. ; *****************************************************************************
  1562. ;
  1563. ;
  1564. ; extern OSStatus BSStoreConnWriteSG(BSStoreConnID writeConnection, MemListDescriptorRef srcMemory, BSBlockListDescriptorRef destBlocks)
  1565. ;
  1566.     IF GENERATINGCFM THEN
  1567.         IMPORT_CFM_FUNCTION BSStoreConnWriteSG
  1568.     ENDIF
  1569.  
  1570. ;
  1571. ;******************************************************************************
  1572. ;
  1573. ;    BSStoreConnReadAsync - reads data from the Store indicated by the Connection.
  1574. ;        This is the asynchronous version of the simple call, taking only a 
  1575. ;        single range.
  1576. ;
  1577. ;    Inputs:        readConnection - the connection to the Store to be read from
  1578. ;                startingOffset - the 64-bit offset into the device to start the
  1579. ;                        read at
  1580. ;                bytesToRead - the 32-bit, unsigned, number of bytes to read
  1581. ;                notification - how the calling app wishes to be notified
  1582. ;                
  1583. ;    Outputs:    buffer - filled in with the bytes read
  1584. ;
  1585. ;    Returns:    E_BSSuccess if successful
  1586. ;                E_BSBadConnection if the connection ID has problems
  1587. ;                E_BSMPIOutOfStoreBounds if the request exceeds the boundaries of 
  1588. ;                    the Store
  1589. ;                E_BSMPIUnitNotResponding if the device does not respond
  1590. ;                E_BSMPITransferError if some error was detected during the transfer
  1591. ;                E_BSMPIMemoryAccessFault if the destination memory was not accessible
  1592. ;                E_BSMPIOutOfResources if a necessary resource (usually memory) could
  1593. ;                    not be allocated
  1594. ;                E_BSMPIMediaRemoved if the media was removed
  1595. ;
  1596. ; *****************************************************************************
  1597. ;
  1598. ;
  1599. ; extern OSStatus BSStoreConnReadAsync(BSStoreConnID readConnection, BSByteCount startingOffset, ByteCount bytesToRead, KernelNotification *notification, void *buffer)
  1600. ;
  1601.     IF GENERATINGCFM THEN
  1602.         IMPORT_CFM_FUNCTION BSStoreConnReadAsync
  1603.     ENDIF
  1604.  
  1605. ;
  1606. ;******************************************************************************
  1607. ;
  1608. ;    BSStoreConnWriteAsync - writes data to the Store a Connection indicates.  
  1609. ;        This is the asynchronous version of the simple call, taking only a
  1610. ;        single range.
  1611. ;
  1612. ;    Inputs:        writeConnection - the connection to the Store to be read from
  1613. ;                srcMem - where the data is to be taken from
  1614. ;                destBlocks - the blocks on the Store where the data is to be placed
  1615. ;                notification - how the caller wishes to be notified
  1616. ;                
  1617. ;    Outputs:    bytesWritten - the number of bytes written
  1618. ;                (srcMem must remain a valid memory area until 
  1619. ;                notification of completion is received)
  1620. ;
  1621. ;    Returns:    E_BSSuccess if successful
  1622. ;            E_BSBadConnection if the connection ID has problems
  1623. ;            E_BSMPIOutOfStoreBounds if the request exceeds the boundaries of 
  1624. ;                the Store
  1625. ;            E_BSMPIUnitNotResponding if the device does not respond
  1626. ;            E_BSMPITransferError if some error was detected during the transfer
  1627. ;            E_BSMPIMemoryAccessFault if the destination memory was not accessible
  1628. ;            E_BSMPIOutOfResources if a necessary resource (usually memory) could
  1629. ;                not be allocated
  1630. ;            E_BSMPIMediaRemoved if the media was removed
  1631. ;
  1632. ; *****************************************************************************
  1633. ;
  1634. ;
  1635. ; extern OSStatus BSStoreConnWriteAsync(BSStoreConnID writeConnection, BSByteCount startingOffset, ByteCount bytesToWrite, KernelNotification *notification, void *buffer)
  1636. ;
  1637.     IF GENERATINGCFM THEN
  1638.         IMPORT_CFM_FUNCTION BSStoreConnWriteAsync
  1639.     ENDIF
  1640.  
  1641. ;
  1642. ;******************************************************************************
  1643. ;
  1644. ;    BSStoreConnReadSGAsync - reads data from the Store indicated by the Connection.
  1645. ;        This is the asynchronous version of the scatter/gather  call.  
  1646. ;        The Block List is generated by the calls above, the Memory List calls 
  1647. ;        can be found in <MemoryLists.h>.
  1648. ;
  1649. ;    Inputs:        readConnection - the connection to the Store to be read from
  1650. ;                srcBlocks - a descriptor indicating the ranges on the device
  1651. ;                    to be read
  1652. ;                destMemory - a Memory List descriptor indicating where the
  1653. ;                    data is to be placed
  1654. ;                notification - how the caller wishes to be notified
  1655. ;                    
  1656. ;    Outputs:    <none>
  1657. ;
  1658. ;    Returns:    E_BSSuccess if successful
  1659. ;                E_BSBadConnection if the connection ID has problems
  1660. ;                E_BSMPIOutOfStoreBounds if the request exceeds the boundaries of 
  1661. ;                    the Store
  1662. ;                E_BSMPIUnitNotResponding if the device does not respond
  1663. ;                E_BSMPITransferError if some error was detected during the transfer
  1664. ;                E_BSMPIMemoryAccessFault if the destination memory was not accessible
  1665. ;                E_BSMPIOutOfResources if a necessary resource (usually memory) could
  1666. ;                    not be allocated
  1667. ;                E_BSMPIMediaRemoved if the media was removed
  1668. ;
  1669. ; *****************************************************************************
  1670. ;
  1671. ;
  1672. ; extern OSStatus BSStoreConnReadSGAsync(BSStoreConnID readConnection, BSBlockListDescriptorRef srcBlocks, MemListDescriptorRef destMemory, KernelNotification *notification)
  1673. ;
  1674.     IF GENERATINGCFM THEN
  1675.         IMPORT_CFM_FUNCTION BSStoreConnReadSGAsync
  1676.     ENDIF
  1677.  
  1678. ;
  1679. ;******************************************************************************
  1680. ;
  1681. ;    BSStoreConnWriteSGAsync - writes data to the Store a Connection indicates. 
  1682. ;        This is the asynchronous version of the scatter/gather call.  The 
  1683. ;        Block List is generated by the calls above, the Memory List calls can
  1684. ;        be found in <MemoryLists.h>.
  1685. ;
  1686. ;    Inputs:        writeConnection - the connection to the Store to be read from
  1687. ;                srcMem - where the data is to be taken from
  1688. ;                    (the memory areas indicated by srcMem must remain valid until 
  1689. ;                    notification is received)
  1690. ;                destBlocks - the blocks on the Store where the data is to be placed
  1691. ;                notification - how the caller wishes to be notified of completion
  1692. ;                
  1693. ;    Outputs:    <none>
  1694. ;                
  1695. ;
  1696. ;    Returns:    E_BSSuccess if successful
  1697. ;            E_BSBadConnection if the connection ID has problems
  1698. ;            E_BSMPIOutOfStoreBounds if the request exceeds the boundaries of 
  1699. ;                the Store
  1700. ;            E_BSMPIUnitNotResponding if the device does not respond
  1701. ;            E_BSMPITransferError if some error was detected during the transfer
  1702. ;            E_BSMPIMemoryAccessFault if the destination memory was not accessible
  1703. ;            E_BSMPIOutOfResources if a necessary resource (usually memory) could
  1704. ;                not be allocated
  1705. ;            E_BSMPIMediaRemoved if the media was removed
  1706. ;
  1707. ; *****************************************************************************
  1708. ;
  1709. ;
  1710. ; extern OSStatus BSStoreConnWriteSGAsync(BSStoreConnID writeConnection, MemListDescriptorRef srcMemory, BSBlockListDescriptorRef destBlocks, KernelNotification *notification)
  1711. ;
  1712.     IF GENERATINGCFM THEN
  1713.         IMPORT_CFM_FUNCTION BSStoreConnWriteSGAsync
  1714.     ENDIF
  1715.  
  1716. ;
  1717. ;******************************************************************************
  1718. ;
  1719. ;    BSStoreConnFlush - Flushes caches for this Store and any Stores this Store
  1720. ;        is derived from.
  1721. ;
  1722. ;    Inputs:        flushConnection - the connection to the Store to be flushed
  1723. ;
  1724. ;    Outputs:    <none>
  1725. ;                
  1726. ;
  1727. ;    Returns:    E_BSSuccess if successful
  1728. ;            E_BSBadConnection if the connection ID has problems
  1729. ;            E_BSMPIUnitNotResponding if the device does not respond
  1730. ;            E_BSMPITransferError if some error was detected during the transfer
  1731. ;            E_BSMPIMemoryAccessFault if the destination memory was not accessible
  1732. ;            E_BSMPIOutOfResources if a necessary resource (usually memory) could
  1733. ;                not be allocated
  1734. ;            E_BSMPIMediaRemoved if the media was removed
  1735. ;
  1736. ; *****************************************************************************
  1737. ;
  1738. ;
  1739. ; extern OSStatus BSStoreConnFlush(BSStoreConnID flushConnection)
  1740. ;
  1741.     IF GENERATINGCFM THEN
  1742.         IMPORT_CFM_FUNCTION BSStoreConnFlush
  1743.     ENDIF
  1744.  
  1745. ;
  1746. ;****************************************************************************
  1747. ; *****************************************************************************
  1748. ;
  1749. ;    Block Storage Accessibility Operations
  1750. ;    
  1751. ; *****************************************************************************
  1752. ; ***************************************************************************
  1753. ;
  1754. ;
  1755. ;******************************************************************************
  1756. ;
  1757. ;    BSStoreConnGoToAccessibilityState - requests that a Store change its
  1758. ;        accessibility state to the one desired
  1759. ;
  1760. ;    Inputs:        connection - connection to the Store to change state
  1761. ;                newState - the desired state
  1762. ;
  1763. ;    Outputs:    <none>
  1764. ;
  1765. ;    Returns:    E_BSSuccess if successful
  1766. ;
  1767. ; *****************************************************************************
  1768. ;
  1769. ;
  1770. ; extern OSStatus BSStoreConnGoToAccessibilityState(BSStoreConnID connection, BSAccessibilityState newState)
  1771. ;
  1772.     IF GENERATINGCFM THEN
  1773.         IMPORT_CFM_FUNCTION BSStoreConnGoToAccessibilityState
  1774.     ENDIF
  1775.  
  1776. ;
  1777. ;******************************************************************************
  1778. ;
  1779. ;    BSContainerConnGoToAccessibilityState - requests that a Container change 
  1780. ;        its accessibility state to the one desired
  1781. ;
  1782. ;    Inputs:        connection - connection to the Container to change state
  1783. ;                newState - the desired state
  1784. ;
  1785. ;    Outputs:    <none>
  1786. ;
  1787. ;    Returns:    E_BSSuccess if successful
  1788. ;
  1789. ; *****************************************************************************
  1790. ;
  1791. ;
  1792. ; extern OSStatus BSContainerConnGoToAccessibilityState(BSContainerConnID connection, BSAccessibilityState newState)
  1793. ;
  1794.     IF GENERATINGCFM THEN
  1795.         IMPORT_CFM_FUNCTION BSContainerConnGoToAccessibilityState
  1796.     ENDIF
  1797.  
  1798. ;
  1799. ;****************************************************************************
  1800. ; *****************************************************************************
  1801. ;
  1802. ;    Block Storage Configuration
  1803. ;    
  1804. ; *****************************************************************************
  1805. ; ***************************************************************************
  1806. ;
  1807. ;
  1808. ;******************************************************************************
  1809. ;
  1810. ;    BSStoreConnGetInfo - gets information about the Store a Connection indicates
  1811. ;
  1812. ;    Inputs:        infoConnection - the connection to the Store we want info about
  1813. ;
  1814. ;    Outputs:    infoBuffer - the information about the Store
  1815. ;
  1816. ;    Returns:    E_BSSuccess if successful
  1817. ;                E_BSBadConnection if the connection ID has problems
  1818. ;
  1819. ; *****************************************************************************
  1820. ;
  1821. ;
  1822. ; extern OSStatus BSStoreConnGetInfo(BSStoreConnID infoConnection, BSStoreInfo *infoBuffer)
  1823. ;
  1824.     IF GENERATINGCFM THEN
  1825.         IMPORT_CFM_FUNCTION BSStoreConnGetInfo
  1826.     ENDIF
  1827.  
  1828. ;
  1829. ;******************************************************************************
  1830. ;
  1831. ;    BSStoreCreate - creates a new Store.  The Store is not added into the Block 
  1832. ;                    Storage Name Store hierarchy.
  1833. ;
  1834. ;    Inputs:        <none>
  1835. ;
  1836. ;    Outputs:    newStore - the ID of the new Store 
  1837. ;                newStoreConnection    - a connection to the created Store
  1838. ;
  1839. ;    Returns:    E_BSSuccess on success
  1840. ;                E_BSENoMoreStores if no more Stores can be allocated
  1841. ;                E_BSOutOfResources if other resources cannot be allocated
  1842. ;
  1843. ; *****************************************************************************
  1844. ;
  1845. ;
  1846. ; extern OSStatus BSStoreCreate(BSStoreID *newStore, BSStoreConnID *newStoreConnection)
  1847. ;
  1848.     IF GENERATINGCFM THEN
  1849.         IMPORT_CFM_FUNCTION BSStoreCreate
  1850.     ENDIF
  1851.  
  1852. ;
  1853. ;******************************************************************************
  1854. ;
  1855. ;    BSStoreConnDeleteAndClose - deletes the Store the current connection 
  1856. ;        references and closes the connection
  1857. ;
  1858. ;    Inputs:        connection - the connection to the Store to be deleted
  1859. ;
  1860. ;    Outputs:    <none>
  1861. ;    Returns:    E_BSSuccess on success
  1862. ;                E_BSStoreInUse if other connections are open to the Store
  1863. ;
  1864. ; *****************************************************************************
  1865. ;
  1866. ;
  1867. ; extern OSStatus BSStoreConnDeleteAndClose(BSStoreConnID connection)
  1868. ;
  1869.     IF GENERATINGCFM THEN
  1870.         IMPORT_CFM_FUNCTION BSStoreConnDeleteAndClose
  1871.     ENDIF
  1872.  
  1873. ;
  1874. ;******************************************************************************
  1875. ;
  1876. ;    BSStoreConnSetPartitionInfo - Sets data in a partition map entry on a Store
  1877. ;
  1878. ;    Inputs:        storeConnection - the connection to the Store
  1879. ;                partitionNum - the partition map entry to be set
  1880. ;                partitionInfo - a pointer to the new partition map entry info
  1881. ;
  1882. ;    Returns:    E_BSSuccess if successful
  1883. ;                E_BSBadConnection if the connection ID has problems
  1884. ;                E_BSPPINoPlugIn if the Store does not have a Partitioning Plug-in
  1885. ;                E_BSPPIOverlappingPartition if the requested partition overlaps
  1886. ;                    another
  1887. ;                E_BSPPIOutOfStoreBounds if the request partition exceeds the limits
  1888. ;                    of the Store
  1889. ;
  1890. ; *****************************************************************************
  1891. ;
  1892. ;
  1893. ; extern OSStatus BSStoreConnSetPartitionInfo(BSStoreConnID storeConnection, ItemCount partitionNum, BSPartitionDescriptor *partitionInfo)
  1894. ;
  1895.     IF GENERATINGCFM THEN
  1896.         IMPORT_CFM_FUNCTION BSStoreConnSetPartitionInfo
  1897.     ENDIF
  1898.  
  1899. ;
  1900. ;******************************************************************************
  1901. ;
  1902. ;    BSStoreConnSetPartitionInfo - Gets data in a partition map entry on a Store
  1903. ;
  1904. ;    Inputs:        storeConnection - the connection to the Store
  1905. ;                partitionNum - the partition map entry to be retrieved
  1906. ;                partitionInfo - a pointer to the partition map entry info buffer
  1907. ;
  1908. ;    Returns:    E_BSSuccess if successful
  1909. ;                E_BSBadConnection if the connection ID has problems
  1910. ;                E_BSPPINoPlugIn if the Store does not have a Partitioning Plug-in
  1911. ;
  1912. ; *****************************************************************************
  1913. ;
  1914. ;
  1915. ; extern OSStatus BSStoreConnGetPartitionInfo(BSStoreConnID connection, ItemCount partitionNum, BSPartitionDescriptor *partitionInfo)
  1916. ;
  1917.     IF GENERATINGCFM THEN
  1918.         IMPORT_CFM_FUNCTION BSStoreConnGetPartitionInfo
  1919.     ENDIF
  1920.  
  1921. ;
  1922. ;******************************************************************************
  1923. ;
  1924. ;    BSStoreConnMapPartition - Maps a partition from a Store onto another Store
  1925. ;
  1926. ;    Inputs:        srcConnection - the connection to the source Store
  1927. ;                partitionNum - the partition to be mapped
  1928. ;                destConnection - the connection to the destination Store
  1929. ;                destStartingBlock - where in the destination Store the mapped 
  1930. ;                    partition should be placed
  1931. ;
  1932. ;    Returns:    E_BSSuccess if successful
  1933. ;                E_BSBadConnection if the connection ID has problems
  1934. ;                E_BSPPINoPlugIn if the Store does not have a Partitioning Plug-in
  1935. ;                E_BSPPIMappingNotSupported if the mapping is not supported by either
  1936. ;                    Store
  1937. ;                E_BSPPIPartitionNonExistant if the source partition doesn't exist
  1938. ;                 E_BSEHierarchyTooDeep if this would create too many layers in the
  1939. ;                    hierarchy (currently limited to 8)
  1940. ;*****************************************************************************
  1941. ;
  1942. ;
  1943. ; extern OSStatus BSStoreConnMapPartition(BSStoreConnID srcConnection, ItemCount partitionNum, BSStoreConnID destConnection, BSByteCount startingByte)
  1944. ;
  1945.     IF GENERATINGCFM THEN
  1946.         IMPORT_CFM_FUNCTION BSStoreConnMapPartition
  1947.     ENDIF
  1948.  
  1949. ;
  1950. ;******************************************************************************
  1951. ;
  1952. ;    BSStoreConnGetComponents - Gets the components of a Store.
  1953. ;
  1954. ;    Inputs:        connection - the connection to the Store
  1955. ;                tableSize - size of the table to be filled in
  1956. ;                componentInfo - a pointer to an array of BSStoreComponentInfos 
  1957. ;                    to be filled in
  1958. ;
  1959. ;    Returns:    E_BSSuccess if successful
  1960. ;            E_BSBadConnection if the connection ID has problems
  1961. ; *****************************************************************************
  1962. ;
  1963. ;
  1964. ; extern OSStatus BSStoreConnGetComponents(BSStoreConnID connection, ItemCount tableSize, BSStoreComponent *componentInfo)
  1965. ;
  1966.     IF GENERATINGCFM THEN
  1967.         IMPORT_CFM_FUNCTION BSStoreConnGetComponents
  1968.     ENDIF
  1969.  
  1970. ;
  1971. ;******************************************************************************
  1972. ;
  1973. ;    BSStoreConnMapDevice - Maps an entire device into a Store
  1974. ;
  1975. ;    Inputs:        srcDevice - the Name Registry ID of the device
  1976. ;                destConnection - the connection to the destination Store
  1977. ;
  1978. ;    Returns:    E_BSSuccess if successful
  1979. ;                E_BSBadConnection if the connection ID has problems
  1980. ; *****************************************************************************
  1981. ;
  1982. ;
  1983. ; extern OSStatus BSStoreConnMapDevice(RegEntryRef srcDevice, BSStoreConnID destConnection)
  1984. ;
  1985.     IF GENERATINGCFM THEN
  1986.         IMPORT_CFM_FUNCTION BSStoreConnMapDevice
  1987.     ENDIF
  1988.  
  1989. ;
  1990. ;******************************************************************************
  1991. ;
  1992. ;    BSStoreConnAssociateMappingPlugin - Attaches a Mapping Plug-in to a Store
  1993. ;
  1994. ;    Inputs:        connection - the connection to the Store
  1995. ;                mappingPlugin - the identifier of the Plugin to be attached
  1996. ;    Returns:    E_BSSuccess if successful
  1997. ;                E_BSBadConnection if the connection ID has problems
  1998. ;                E_BSEPlugInNotFound if the plugin specified can't be found
  1999. ; *****************************************************************************
  2000. ;
  2001. ;
  2002. ; extern OSStatus BSStoreConnAssociateMappingPlugin(BSStoreConnID connection, BSMappingPlugInRef mappingPlugin)
  2003. ;
  2004.     IF GENERATINGCFM THEN
  2005.         IMPORT_CFM_FUNCTION BSStoreConnAssociateMappingPlugin
  2006.     ENDIF
  2007.  
  2008. ;
  2009. ;******************************************************************************
  2010. ;
  2011. ;    BSStoreConnAssociatePartitioningPlugin - Attaches a Partitioning Plug-in to 
  2012. ;        a Store
  2013. ;
  2014. ;    Inputs:        connection - the connection to the Store
  2015. ;                mappingPlugin - the identifier of the Plugin to be attached
  2016. ;    Returns:    E_BSSuccess if successful
  2017. ;                E_BSBadConnection if the connection ID has problems
  2018. ;                E_BSEPlugInNotFound if the plugin specified can't be found
  2019. ; *****************************************************************************
  2020. ;
  2021. ;
  2022. ; extern OSStatus BSStoreConnAssociatePartitioningPlugin(BSStoreConnID connection, BSPartitioningPlugInRef mappingPlugin)
  2023. ;
  2024.     IF GENERATINGCFM THEN
  2025.         IMPORT_CFM_FUNCTION BSStoreConnAssociatePartitioningPlugin
  2026.     ENDIF
  2027.  
  2028. ;
  2029. ;******************************************************************************
  2030. ;
  2031. ;    BSStoreConnPublish - makes a Store available for general use
  2032. ;
  2033. ;    Inputs:        connection - the connection to the Store
  2034. ;    Returns:    E_BSSuccess if successful
  2035. ;                E_BSBadConnection if the connection ID has problems
  2036. ; *****************************************************************************
  2037. ;
  2038. ;
  2039. ; extern OSStatus BSStoreConnPublish(BSStoreConnID connection)
  2040. ;
  2041.     IF GENERATINGCFM THEN
  2042.         IMPORT_CFM_FUNCTION BSStoreConnPublish
  2043.     ENDIF
  2044.  
  2045. ;
  2046. ;******************************************************************************
  2047. ;
  2048. ;    BSStoreConnUnpublish - removes a Store from general use
  2049. ;
  2050. ;    Inputs:        connection - the connection to the Store
  2051. ;    Returns:    E_BSSuccess if successful
  2052. ;                E_BSBadConnection if the connection ID has problems
  2053. ; *****************************************************************************
  2054. ;
  2055. ;
  2056. ; extern OSStatus BSStoreConnUnpublish(BSStoreConnID connection)
  2057. ;
  2058.     IF GENERATINGCFM THEN
  2059.         IMPORT_CFM_FUNCTION BSStoreConnUnpublish
  2060.     ENDIF
  2061.  
  2062. ;
  2063. ;******************************************************************************
  2064. ;
  2065. ;    BSStoreConnFormat - formats a Store in the specified format
  2066. ;
  2067. ;    Inputs:        connection - the connection to the Store
  2068. ;                formatType - the format number from possibleFormats in the
  2069. ;                    BSStoreInfo structure
  2070. ;                    
  2071. ;    Returns:    E_BSSuccess if successful
  2072. ;                E_BSBadConnection if the connection ID has problems
  2073. ; *****************************************************************************
  2074. ;
  2075. ;
  2076. ; extern OSStatus BSStoreConnFormat(BSStoreConnID connection, BSFormatIndex formatType)
  2077. ;
  2078.     IF GENERATINGCFM THEN
  2079.         IMPORT_CFM_FUNCTION BSStoreConnFormat
  2080.     ENDIF
  2081.  
  2082. ;
  2083. ;******************************************************************************
  2084. ;
  2085. ;    BSContainerConnGetInfo - gets information about the Container  a Connection indicates
  2086. ;
  2087. ;    Inputs:        infoConnection - the connection to the Container we want info about
  2088. ;
  2089. ;    Outputs:    infoBuffer - the information about the Container
  2090. ;
  2091. ;    Returns:    E_BSSuccess if successful
  2092. ;                E_BSBadConnection if the connection ID has problems
  2093. ;
  2094. ; *****************************************************************************
  2095. ;
  2096. ;
  2097. ; extern OSStatus BSContainerConnGetInfo(BSContainerConnID infoConnection, BSContainerInfo *infoBuffer)
  2098. ;
  2099.     IF GENERATINGCFM THEN
  2100.         IMPORT_CFM_FUNCTION BSContainerConnGetInfo
  2101.     ENDIF
  2102.  
  2103. ;
  2104. ;******************************************************************************
  2105. ;
  2106. ;    BSContainerCreate - Creates a new Container.  The Container is not added 
  2107. ;        into the Block Storage Container Hierarchy
  2108. ;
  2109. ;    Inputs:        <none>
  2110. ;
  2111. ;    Outputs:    newContainer - a connection to the newly created Container
  2112. ;
  2113. ;    Returns:    E_BSSuccess if successful
  2114. ;
  2115. ; *****************************************************************************
  2116. ;
  2117. ;
  2118. ; extern OSStatus BSContainerCreate(BSContainerConnID *newContainer)
  2119. ;
  2120.     IF GENERATINGCFM THEN
  2121.         IMPORT_CFM_FUNCTION BSContainerCreate
  2122.     ENDIF
  2123.  
  2124. ;
  2125. ;******************************************************************************
  2126. ;
  2127. ;    BSContainerConnDeleteAndClose - deletes the Container and closes the 
  2128. ;        connection to it.  No other connections to the Container may be open.
  2129. ;
  2130. ;    Inputs:        deleteContainer - connection to the Container to be deleted    
  2131. ;
  2132. ;    Outputs:    <none>
  2133. ;
  2134. ;    Returns:    E_BSSuccess if successful
  2135. ;
  2136. ; *****************************************************************************
  2137. ;
  2138. ;
  2139. ; extern OSStatus BSContainerConnDeleteAndClose(BSContainerConnID deleteContainer)
  2140. ;
  2141.     IF GENERATINGCFM THEN
  2142.         IMPORT_CFM_FUNCTION BSContainerConnDeleteAndClose
  2143.     ENDIF
  2144.  
  2145. ;
  2146. ;******************************************************************************
  2147. ;
  2148. ;    BSContainerConnInsertContainer - inserts a Container into another Container
  2149. ;
  2150. ;    Inputs:        destContainer - a connection to the Container to insert into
  2151. ;                insertContainer - connection to the Container to be inserted
  2152. ;
  2153. ;    Outputs:    <none>
  2154. ;
  2155. ;    Returns:    E_BSSuccess if successful
  2156. ;
  2157. ; *****************************************************************************
  2158. ;
  2159. ;
  2160. ; extern OSStatus BSContainerConnInsertContainer(BSContainerConnID destContainer, BSContainerConnID putContainer)
  2161. ;
  2162.     IF GENERATINGCFM THEN
  2163.         IMPORT_CFM_FUNCTION BSContainerConnInsertContainer
  2164.     ENDIF
  2165.  
  2166. ;
  2167. ;******************************************************************************
  2168. ;
  2169. ;    BSContainerConnPublish - makes a Container available for use.  Generates
  2170. ;        notifications as necessary
  2171. ;
  2172. ;    Inputs:        publishContainer - connection to the Container to be published
  2173. ;
  2174. ;    Outputs:    <none>
  2175. ;
  2176. ;    Returns:    E_BSSuccess if successful
  2177. ;
  2178. ; *****************************************************************************
  2179. ;
  2180. ;
  2181. ; extern OSStatus BSContainerConnPublish(BSContainerConnID publishContainer)
  2182. ;
  2183.     IF GENERATINGCFM THEN
  2184.         IMPORT_CFM_FUNCTION BSContainerConnPublish
  2185.     ENDIF
  2186.  
  2187. ;
  2188. ;******************************************************************************
  2189. ;
  2190. ;    BSContainerConnUnpublish - removes a Container from general accessibility,
  2191. ;        does not delete it.  The Container must not have any open connections or
  2192. ;        published children.
  2193. ;
  2194. ;    Inputs:        unpublishContainer - the Container to unpublish
  2195. ;
  2196. ;    Outputs:    <none>
  2197. ;
  2198. ;    Returns:    E_BSSuccess if successful
  2199. ;
  2200. ; *****************************************************************************
  2201. ;
  2202. ;
  2203. ; extern OSStatus BSContainerConnUnpublish(BSContainerConnID unpublishContainer)
  2204. ;
  2205.     IF GENERATINGCFM THEN
  2206.         IMPORT_CFM_FUNCTION BSContainerConnUnpublish
  2207.     ENDIF
  2208.  
  2209. ;
  2210. ;******************************************************************************
  2211. ;
  2212. ;    BSContainerConnSetDevice - sets the device the Container plug-in will 
  2213. ;        associate with.  Should be called before BSContainerConnAssociatePlugIn
  2214. ;        for bare Containers.
  2215. ;
  2216. ;    Inputs:        connection - a connection to the Container we're associating
  2217. ;                    the plug-in with
  2218. ;                deviceNode - the device the Container plug-in will interact with
  2219. ;
  2220. ;    Outputs:    <none>
  2221. ;
  2222. ;    Returns:    E_BSSuccess if successful
  2223. ;
  2224. ; *****************************************************************************
  2225. ;
  2226. ;
  2227. ; extern OSStatus BSContainerConnSetDevice(BSContainerConnID connection, RegEntryRef deviceNode)
  2228. ;
  2229.     IF GENERATINGCFM THEN
  2230.         IMPORT_CFM_FUNCTION BSContainerConnSetDevice
  2231.     ENDIF
  2232.  
  2233. ;
  2234. ;******************************************************************************
  2235. ;
  2236. ;    BSContainerConnAssociatePlugIn - Associates a Container plug-in with a
  2237. ;        Container
  2238. ;
  2239. ;    Inputs:        connection - a connection to the Container we're associating
  2240. ;                    the plug-in with
  2241. ;                plugIn - the new plug in to be associated
  2242. ;
  2243. ;    Outputs:    <none>
  2244. ;
  2245. ;    Returns:    E_BSSuccess if successful
  2246. ;
  2247. ; *****************************************************************************
  2248. ;
  2249. ;
  2250. ; extern OSStatus BSContainerConnAssociatePlugIn(BSContainerConnID connection, BSContainerPlugInRef plugIn)
  2251. ;
  2252.     IF GENERATINGCFM THEN
  2253.         IMPORT_CFM_FUNCTION BSContainerConnAssociatePlugIn
  2254.     ENDIF
  2255.  
  2256.     ENDIF
  2257.     ENDIF ; __BLOCKSTORAGE__ 
  2258.  
  2259.